import axios from '@/libs/request/axios'

// 多条件分页查询见证人信息列表
export const getWitnessListData = (params) => {
    return axios.request({
        url: '/channel/witness/getWitnessList',
        params: params,
        method: 'POST'
    })
}

// 多条件分页查询见证人信息列表
export const getWitnessUseChannel = (params) => {
    return axios.request({
        url: '/channel/witness/getWitnessUseChannel',
        data: params,
        method: 'POST'
    })
}
// 见证人审核列表
export const getRegister = (params) => {
    return axios.request({
        url: '/channel/witness/getRegister',
        data: params,
        method: 'POST'
    })
}

/**
 *新增见证人
 * @param obj
 * @returns {*}
 */
export function save(obj) {
    return axios.request({
        url: '/channel/witness/save',
        method: 'POST',
        data: obj
    })
}

/**
 * 修改见证人
 * @param obj
 * @returns {*}
 */
export function edit(obj) {
    return axios.request({
        url: '/channel/witness/edit',
        method: 'POST',
        data: obj
    })
}

// 修改为停用状态
export function upAllByIds(obj) {
    return axios.request({
        url: `/channel/witness/upAllByIds`,
        method: 'POST',
        data: obj
    })
}

// 删除见证人
export const delWitness = (obj) => {
    return axios.request({
        url: `/channel/witness/delete`,
        method: 'POST',
        data: obj,
    })
};

/**
 *新增黑名单
 * @param obj
 * @returns {*}
 */
export function saveBlack(obj) {
    return axios.request({
        url: '/channel/black/save',
        method: 'POST',
        data: obj
    })
}

// 根据有id 获取信息
export const getWitnessById = (obj) => {
    return axios.request({
        url: `/channel/witness/getWitnessById`,
        method: 'POST',
        data: obj,
    })
};

// 案件的同步保存
export const getCaseSave = (obj) => {
    return axios.request({
        url: `/case/witness/save`,
        method: 'POST',
        data: obj,
    })
};
// 审批
export function toExamine(obj) {
    return axios.request({
        url: '/channel/witness/toExamine',
        method: 'POST',
        data: obj
    })
}

export function checkRole(obj) {
    return axios.request({
        url: '/channel/witness/checkRole',
        method: 'POST',
        data: obj
    })
}
// 工作流发起
export function workflow(obj) {
    return axios.request({
        url: '/channel/witness/workflow',
        method: 'POST',
        data: obj
    })
}
// 工作流审核
export function workflowEx(obj) {
    return axios.request({
        url: '/channel/witness/workflowEx',
        method: 'POST',
        data: obj
    })
}

/**================================ 分割线=======================下面是进件使用的===========上面 渠道用的=============== */

// 多条件分页查询见证人信息列表
export const getChannelWitnessListData = (params) => {
    return axios.request({
        url: '/apply/applyUserChannel/getChannelWitnessListData',
        data: params,
        method: 'POST'
    })
}
// 删除方法
export const channelDelWitness = (obj) => {
    return axios.request({
        url: `/apply/applyUserChannel/channelDelWitness`,
        method: 'POST',
        data: obj,
    })
};

// 修改为停用状态
export function channelUpAllByIds(obj) {
    return axios.request({
        url: `/apply/applyUserChannel/wintnessUpAllByIds`,
        method: 'POST',
        data: obj
    })
}

// 根据有id 获取信息
export const getChannelWitnessById = (obj) => {
    return axios.request({
        url: `/apply/applyUserChannel/getWitnessById`,
        method: 'POST',
        data: obj,
    })
};

/**
 *新增黑名单
 * @param obj
 * @returns {*}
 */
export function channelSaveBlack(obj) {
    return axios.request({
        url: '/apply/applyUserChannel/witnessSaveBlack',
        method: 'POST',
        data: obj
    })
}
// 保存见证人
export function channelSave(obj) {
    return axios.request({
        url: '/apply/applyUserChannel/witnessSave',
        method: 'POST',
        data: obj
    })
}
// 见证人修改
export function channelEdit(obj) {
    return axios.request({
        url: '/apply/applyUserChannel/witnessEdit',
        method: 'POST',
        data: obj
    })
}

// 审批
export function channelToExamine(obj) {
    return axios.request({
        url: '/apply/applyUserChannel/witnessToExamine',
        method: 'POST',
        data: obj
    })
}

// 查询有没有正在使用的权限账号和正在见证中的合同
export function channelCheckRole(obj) {
    return axios.request({
        url: '/apply/applyUserChannel/witnessCheckRole',
        method: 'POST',
        data: obj
    })
}
